/*
 *  RIBuildIndexSVPR.java
 *
 */

package at.ofai.gate.riplugin2;


import gate.creole.*;


/** 
 * Abstract base class for all index LRs used in this plugin.
 */
public abstract class RIIndexLR
  extends AbstractLanguageResource
{

  /**
   * Open an index for use. Returns false if the index could not be
   * opened for some reason (e.g. because there is no data yet).
   */
  abstract boolean open();

  /**
   * close index
   */
  abstract void close();
  
  /**
   * True if the index actual has index data (is not still empty)
   * @return
   */
  abstract boolean hasData();

  /**
   * Check if the index is open and usable (implies that it hasData() )
   * @return
   */
  abstract boolean isOpen();

  @Override
  public void cleanup() {
    close();
  }


} // class RIIndexLR
